#ifndef __MMAN_H__
#define __MMAN_H__

#include <types.h>
#include <multiboot.h>

struct pages_stack_type {
    uint32_t *pages;
    uint32_t npages;
    uint32_t free_pages;
};

void mman_init(void);
uint32_t alloc_mempool(struct pages_stack_type *pool);
uint32_t alloc_mempools(struct pages_stack_type *pool, uint32_t npages);
uint32_t alloc_page();
uint32_t alloc_lowpage();
uint32_t alloc_pages(uint32_t npages);
uint32_t alloc_lowpages(uint32_t npages);
uint32_t lock_mempool(struct pages_stack_type *pool, uint32_t start,
		      uint32_t end);
uint32_t lock_lowpages(uint32_t start, uint32_t end);
uint32_t lock_pages(uint32_t start, uint32_t end);
void free_mempool(struct pages_stack_type *pool, uint32_t block);
void free_mempoolrange(struct pages_stack_type *pool, uint32_t start,
		       uint32_t end);
void free_page(uint32_t block);
void free_lowpage(uint32_t block);
void free_pages(uint32_t start, uint32_t end);
void free_lowpages(uint32_t start, uint32_t end);

#endif	/* __MMAN_H__ */

